package com.company;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class LockObject extends Object {
    private final Lock lock = new ReentrantLock();
    LockObject(){
        if (null != lock){
            lock.lock();
        }
    }

    protected void finalize(){
        if (null != lock){
            lock.unlock();
        }
    }
}
